Method to encode the header of a generated event.

New method that encodes the header of a generated event. The following fields can be specified:
- timestamp
- version
- opcode
- provider_id

R=etienneb@chromium.org

Review URL: https://codereview.appspot.com/17550043