Restructure Core

Define the top-level module and then autoload all the classes within it

Have also moved a few things about
Merge branch 'restructure-core'