Unit tests for teams controller

...more angular unit tests.

I've also added JS test coverage. Once tests are run (or they can be run continuously with `karma start`) an HTML coverage report is generated in `coverage/`.