Added comments and small code changes

Added more comments to the code. Changed the static variable to a
singleton class and. Made small changes to the high score handling.