added units tests for base64 encoding
more unit tests and small fixes