Begin controller support

Began writing controller support, and added a bit of code elsewhere.
Definitely going to have to rearrange and refactor some of this code, as
it's been forever since I did anything in Python, and I don't recall the
pythonic way to do a lot of things.