Initial refactor commit. Lots of changes.
Wrap it up, folks.
Merge branch 'refactor'