Final tidy up and allow running as a single jar from command line