m_identity: Make password check pluggable

Also document how to migrate from an alternative (legacy) password
hashing scheme.