Angular refactor

Refactored code to use AngularJS.
set `$scope.tuning` to a copy of the array