Remove some dead code
Add a testsuite