Implemented logging. Closes #79.