Use logger instead of stdout and stderr

Implements suggestion from #409

<!---
@huboard:{"order":64.703125,"milestone_order":410,"custom_state":""}
-->