Refactor angularjs app.

Separate modules into their own files.