#8: more refactoring, tests are significantly less broken now, and the API is even simpler