Some database refactoring (remove lots of ugly static/global variables, add
a row cache for displaying games from database, allow simple sort on some
columns after games loaded into memory, fix 'zombie' bug which was caused
by wrongly incrementing the game index even when a game insert was rejected
due to it being a duplicate.