rewrite to IIFE
rewrite to controllerAs
rewrite directive to johnpapa style
add jshint config and fix error