TMS: clean up

Removed unused import in vews.TMS.
Raise a proper exception when trying to update a non-row instance.
Added a test for that exception in tests.TMSTests, also refactored
tests.TMSTests.test_destroy_database as it fails when run with
everthing else but succeeds when run all by itself.

TODO: still, file management.