Replace all non-angular JS code with AngularJS Services.