Added public methods to encode and decode cookies

Please see issue #21 for description of what this pull request intends to solve.