Started major rewrite of controller to make it less idiotic and Python 3.4 compatible.