Tidy up, renaming, refactoring, generally getting things working