WIP rewriting core systems for gamelogic

Decoupling and functionalising parts of the code.