fixed issues #1. thanks @jasperblues

fixed bug in Base64 encode. (encode empty data)
clean up hex encode/decode.