fixing potential NPE when no stream is available
added embedded Tomcat 7 for tests, use servlets 3
Moving tests to embedded Tomcat
added some javadoc and removed unnecessary line
moving tests to tomcat server