Added methods for deactivating and checking if a credential is valid, updated tests