Massive restructure

Fixed a lot of silly errors and restructured the code in such a way that
we should now be able to add the network play!