Make kcdshell use psycopg2.
Don't hardcode the path to the configuration file.
Remove all calls to redirect_to from kas_cfg. Replaced them with simple calls to 'redirect'.