Clean up unit tests, add more for new functionality