Fix the parsing of the type field in Event msgs

- According to the standard, the most significant bit of the 8-bit type code is
  used to flag if the event was generated from a SendEvent request. See Event
  Format section in Chapter 1 of the specification.
Merge pull request #27 from santigimeno/fix_event_type_parsing

Fix the parsing of the type field in Event msgs
Add support for signed data

- Use Buffer write functions
Fix format of some requests
Merge pull request #28 from santigimeno/fix_unpack_bufferx

Add support for signed data in unpackbuffer