Cleanup, add tests, fix sniffs