Factored out account-contains? from select-entries-with and exclude-entries-with.