Refactor manage.py to be more easily callable by wrappers.
Refactor manage.py to be more easily callable by wrappers.

This fixes up manage.py so it can be called with a custom settings file
by a wrapper (such as another manage.py script). There's now a 'main'
function that takes a settings module and operates on that, instead of
assuming it's using the 'settings' module from reviewboard.settings. By
default, of course, this is reviewboard.settings.

This is used by RBCommons to reduce code duplication, since we want the
same logic, but a different settings.

1tush/reviewboard,1tush/reviewboard,sgallagher/reviewboard,davidt/reviewboard,1tush/reviewboard,sgallagher/reviewboard,KnowNo/reviewboard,sgallagher/reviewboard,beol/reviewboard,reviewboard/reviewboard,davidt/reviewboard,davidt/reviewboard,KnowNo/reviewboard,KnowNo/reviewboard,KnowNo/reviewboard,bkochendorfer/reviewboard,reviewboard/reviewboard,brennie/reviewboard,1tush/reviewboard,bkochendorfer/reviewboard,custode/reviewboard,custode/reviewboard,1tush/reviewboard,brennie/reviewboard,bkochendorfer/reviewboard,brennie/reviewboard,beol/reviewboard,davidt/reviewboard,chipx86/reviewboard,sgallagher/reviewboard,beol/reviewboard,custode/reviewboard,brennie/reviewboard,bkochendorfer/reviewboard,1tush/reviewboard,1tush/reviewboard,beol/reviewboard,chipx86/reviewboard,reviewboard/reviewboard,1tush/reviewboard,1tush/reviewboard,chipx86/reviewboard,custode/reviewboard,chipx86/reviewboard,reviewboard/reviewboard