Start adding tests.
Remove unused code.