Remove a bunch of dead code.
Add more tests, fix more bugs.