Added support for custom headers in encode method
Merge pull request #34 from vanzi/master

Added support for custom headers in encode method