Bug 1000839: Fixes and unit tests for NfcUtils.encodeNDEF()

Yes, please do that. What I concern is if someone want to maintain these code after us, what he/she can see first is the whole file is filled with such magic binary code without any explanation.