Make handling of NFC Intents more robust.

The app could be put in a wrong state after by turning the device off and on while the app was running. This change fixes this and closes #13.