fix jshint errors
add comments, change handling of fromValue functions to better handle undefined values.