API changes

Lots of stuff addressed in this - mainly changing the API and retesting, which led to some other fixes along the way.

Closes #20
Closes #21
Closes #22
Closes #14
Closes #17
Closes #6
Closes #12 

At this stage, the core is refactored and tested - but the various plugins and components have not yet been updated.