Add Angular tests for the controllers.

This doesn't test everything, but it is scaffolding, and it is a start. This also includes some changes to make the controllers more testable, and some more Angular bits we didn't have before.