Cleanup

Generate some functions on prototype in advance instead of at the start
of each game.