Implement NFC target mode

Also fix a bug where the bit count check was the wrong way round.