Unit testing and some modest cleanup.