refactorings

- new util function try_silent
- prettify output of print_knitlog

The first two commits of #651, in isolation for easier review.