Substantial refactor to publish to public repo
Merge branch 'private master' into master