WIP - localhost exception

These changes fix the functional test suite.  I'm still working on the rest of our tests, but if you see any patterns forming in my fixes that I should avoid, please let me know!  I wanted to open the code review on this because it's a lot of changes.
or ensure_logged_in_admin_user