utility functions to check for null, undefined in javascript projects
Adds .to_nil methods to Object. We have to_s and to_i, why not to_nil?