code improvements, functions in objects, jslint/jshint valid (v0.3.0)