Refactored base servlets with shared code base ServletUtils. Added a mechanism in config.js to check that baseUrl is the same as location.href and provide an override if necessary.