Add group (='application') attribute to the debug options.
Use the options object in the options module straightforwards.
Add the options about database into the options.py and config.py.