Overhauling most stuff.

This will compile but is not functional yet. I have to run out :/