Complete rewrite

Removed a tonne of code, leaving us with 1 file :)