Parse logs

This is a rebase and cleanup of https://github.com/puppetlabs/mcollective-puppet-agent/pull/7