Fix header debug output

Replace `[object Object]` with several fine-grained logging options.
Improve logging format.
Switch to simple logs with debug controls
Merge pull request #1 from timshadel/master

Fixup debug headers