JSHint and code refactoring to using AngularJS controller definition.
Better code indentation and dependencies managed.