Cleanup of cleaner lib, also added the logging stuff.