Add specs for Logger, and refactor slightly.