Kjq/rework

Massive rewrite/organization.
I'm just gonna merge this.