More major rewrite.

This commit message is shit because I can't be fucked writing anything
Haven't commited in a while. Whoops.

Lots of changes here but I won't go into them.

I have removed the Android code from this though (although not updated the grunt file just yet)