First commit. Rough outline of class/interface structure and some program flow. Loads of refactoring required.