[Do not merge] Major cleanup

Rewriting a bunch of stuff since the brain is quickly degrading.

<!---
@huboard:{"order":9.25,"custom_state":""}
-->