Add global highscore functionality, and refactor some stuff