fixed issues #2. thanks @jasperblues

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