Added db indices and tests for email uniqueness