Got base64 encoding to work on test cases
Added more tests
Cleaned up code and documented