Added log4j and IP filtering, as well as some refactoring.