Write more unit tests, flesh out test framework