Refactored back end into new 'base' class which controls the logic of the game. This is so that the GUI and the logic is weakly coupled.