fix tomcat startup problems
add refactorings & cleanup
remove unused constant
add unit tests
Merge remote-tracking branch 'origin/master'