Added support for custom headers in encode method

Added simple support for custom headers. We needed this to pass the "kid" header (as specified in http://self-issued.info/docs/draft-jones-json-web-token-01.html#rfc.section.5.1) to identify the secret key used for signing the token, but this way other headers may be set as well.