Logging refactor. Closes #14