cleanup with jshint and addition of example

@cheddar not required but this has all the jshint cleanup