Adding in BaseURL refactoring for support of GAE and Tomcat