Call all database functions in a transaction.

Extend the Postgres class from the connection class of psycopg2. Use the
with keyword supported by psycopg2 for transactions.
Add --debug argument.
Add worker.py to send emails.
Rename the default configuration file.