Dumped lots of old crud. Tidied up some code.