Remove some dead code.
Add more tests.
Add a whole bunch more tests.