Liberal use of SCRIPT_NAME for relocatability.

We want to host the Flask app under '/neuropost/*' and that required a
bit of URL munging.  (I could have hard-coded it to save time, but
c'mon.)