Logging causes memory use to increase forever

Todo:
- [x] Add a logger which can be used in prod
- [ ] Enable this logger by default in prod (unsure how this can be done, feel free to propose or take over if first commit looks ok)

See prior discussion on #22.