basic implementation of validation levels

Closes #6213
What about the following cases (maybe they depend on the todos marked in the beginning of the function)?

(a) verified key transitions (when the new key is signed by the previously registered key for same address).
(d) If the registered key has never been successfully used and the new key has a higher validation level.
(e) If the registered key has no expiration date.