Several bug fixes, refactorings and reworked gamecontroller