Add unit tests and other cleanups