added method to return game state as JSON
merging with master upstream