Add model scopes and related tests.