Database-based accounts and ticket verification.

Temporarily removed logging to file until I can be bothered to write a
better asynchronous solution.