change base64 (encoding) implementation; add base64 tests (one of them doesn't pass, needs checking)