Remove dead code, comments and cruft

Just a general tidy-up so we can see more clearly what's going on