Switching to AngularJS and did a few bug fixes