Move datastores logic to models.

Change-Id: Ia6333cb70dd62085bc6ad1f24250c8930bb915a3
Check to ensure account is active.

When account is deactivated, the datastore entry is deleted, and
as such it is an error to call the datastore methods on the
deactivated account.

Change-Id: Ifd8c87eac570c230c1dde897b3969af8237dbb60