cleanup

first authenticate depending on app state,
then register for appState changes.
fix build of tests
fix passed in udid not validated

any udid could be passed, so it only
failed on next launch and showed the
view controller again.
fix typo
use keychain attribute thisDeviceOnly instead of custom validation

instead of storing the vendorIdentifier, use the keychain to store
the token on this device only
show proper error when UDID it not allowed to access