Added achievements support, implemented loading and saving of game results and cleaned up code