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.
I would use a constant in place of 13.