Clean up Redis keys a bit

Rename a few things, add comments, and factor out some other bits relating
to Redis key mapping.