munger completion and refactoring, and a lot of unit tests