Bug 1039245 - [NFC] Move NDEF record payload parsing from NfcManager and expose it to app developers, r=gweng

Basically I hope to use `forEach` or `map` and `reduce` if it's possible to make code more clear, and it would also eliminate the 'i,j,k' variables. This loop only uses the index `r` once to reference the `record` and we only interrupt the loop and function here, so I think it's possible to do the change.

I think it's even to use `reduce` since your action seems have the type: `[Record] -> Post`, it match the use case of  the `reduce` function. The `reduce` version could be:

    return reduce(records, (postResult, record) => {
        // do what the loop now do.
        if (result.text[...]) {
            return null;
        } else {
            return posterResult;
        }
    }, poster);

However, if there is any concern that blocks us to do that, please let me know. Thanks.