Cleanup

This removes a bunch of code and changes tests so that they match the API.

cc @gangleri