Add support for returning header

The caller might need to access header elements, such as 'typ' or
'cty', in order to properly validate and parse the payload.

A new function is added that returns the header in addition to the
payload.
Merge pull request #2 from boivie/return-header

Add support for returning header