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

`forEach` and avoid i,j,k variables.