Parse Received headers and include in output.

Fix #20
Extract utility functions from class.
Remove unused imports.
Remove unused functions.
Remove more unused code.