Loads of fixes and improvements, and general code re-organisation.
In particular, the modules can now be installed without errors.
First testable version.
Initial release.