Added log4j support and default debug logging, some javadocs