refactoring gui module to be easily embeddable in a Servlet 3.0 container