Added some tests for builder, encodeUri and toByteArray

Tests! I'm pretty new with tests so let me know if you have any suggestions.