Tomcat7 support

I took the topic branch by @mcortesi and @phillip and rebased it onto the uptream master. I also added commits to account for the 2 issues outlined in the previous PR.