Add url safe encoding/decoding

Add url safe encoding/decoding compatible with http://docs.python.org/2/library/base64.html#base64.urlsafe_b64encode.