Wrote some initial unit tests.
* Dropped in a few TODOs that I don't want to forget.