implement "correct" ndef parsing
optimize code abit
Merge pull request #622 from emdete/p1

P1