Code Rewrite

Completely rewritten the entire engine. Old version now sits in v1
folder.