Tidying up source code for release. Also refactored World to use a Group instance, rather tha duplicate functions.