Restructured application to use AngularJS.