A tonne of refactoring and templating.
Merge remote-tracking branch 'origin/master'