Refactoring InitialContext + Server class to support PHPUnit tests