Base64 encoder/decoder and tests

As described in the draft 21, section 2 of JWT, the Base64 string should
be safe and trailing = have to be omitted (http://tools.ietf.org/html/draft-ietf-oauth-json-web-token-21#section-2).

This PR includes new functions to encode and decode according to this
draft.
You are right, this is an old function I used when encoder/decoder functions where in the JWT class.
I will remove it in a next commit.