Added logging using slf4j and log4j12. Updated faulty test because of nondeterminism. Fixes #21.