Added public encode and decode methods for 0.1.0 tagged version

This is a replacement for this pull request: https://github.com/mozilla/node-client-sessions/pull/22

Merging in and rebasing the previous code into 0.1.0 became a bit to messy and a bit too much juggling to do with just git so I ended up doing it manually to not mess up anything. Hench a new pull request.

All tests passes on tagged 0.1.0 version and with node version 0.10.0.