Delete dead code and move tests around.