Reorganize authentication and DB connection

- Store the current user in g.user and g.db
- Rename the @autorollback decorator to the more accurate @rollback_on_exception
Authentication: use g.conn instead of opening another connection
Remove test for is_authenticated()

It never worked, and it is going to be replaced with tests that call the web API.
Add API endpoint to create posts. Simplify returning JSON responses.

Wrap jsonify({'success': <something>, '<property>': <value>}) in two functions:
- successResponse(field, payload): returns a jsonified response with a success=true
  field and a custom field with a payload
- errorResponse(message): returns a jsonified response with a success=false and a
  message field.
Use separate DB for testing. Start writing tests for the API.