Refactoring interaction with embedded tomcat instance to allow direct inspection/modification of headers