Fix various bugs in account models

Previously, changes to or removals of an account would only be
detected by the model if the account was created during the lifetime
of the model.  This commit ensures that all such changes in the
database are detected by the model.  It also fixes removal-related
bugs in the service accounts model.