Initial work

I used nose for testing and followed a much more TDD workflow than I usually do.

Test coverage is very good! On the flip side, I don't know if this actually works yet :)
Thanks. Was a good opportunity to try out the different tools in the `mock` module. The `@mock.patch` decorator and `mock.MagicMock` are both really nice.