quizzer: Add user keys to the answer database and stack
Instead of:
answerdb[question.id] = [list, of, answers]
ui.stack = [list, of, questions]
Now we have:
answerdb[user.name][question.id] = [list, of, answers]
ui.stack[user.name] = [list, of, questions]
This will allow us to use a single answer database and stack for a
multi-user interface (e.g. WSGI). I've added the appropriate upgrade
rules to update existing answer databases once we bump to v0.4.
To reduce redundancy and ease future maintenance, I also factored out
AnswerDatabase._get_questions() from .get_unanswered() and friends.
There's a bit of hackery to deal with the default None user in the
answer database. Because JSON objects (the equivalent of Python's
dicts) are keyed by strings, you get things like:
>>> import json
>>> json.dumps({None: 'value'})
'{"null": "value"}'
We avoid this and preserve the None key through a save/load cycle by
replacing it with the empty string. This means that you shouldn't use
the empty string as a user name when interacting with the database
from Python, and we'll raise a ValueError if you try to do that
through AnswerDatabase-specific methods.