[MIN] Use 301 for compat redirects
[IMP] use app.debug and ensure db conn in wrappers
[MIN] use 302 for compat redirs in debug mode