Fixing a lot of issues.  Adding some tests for utils.