Added logging through log4j. This closes #3