Fixed controller_test.py
Many small cleanups, mainly unit tests