Finish refactoring api/test.py.
TagManagerTests: More refactoring