Angular refactor

Refactored code to use AngularJS.
woops nvm