check if called command is a function

and jslint cleanup
closes #4