Allow array or hash syntax for partial index conditions

This is the newer version of #13353, based off of the latest master. It allows you to replace these migrations:

```ruby
add_index :foos, :user_id, unique: true, where: "status IN (0, 1)"
```

With this:

```ruby
add_index :foos, :user_id, unique: true, where: { status: [1, 2] }
```

It understands any Array that `ActiveRecord::Sanitization.sanitize_sql_array` accepts, and any Hash that `ActiveRecord::PredicateBuilder` accepts. It would've been great to just use `ActiveRecord::Sanitization.sanitize_sql_for_conditions` directly, but its implementation of `sanitize_sql_hash_for_conditions` assumes it is being called from within a `ActiveRecord::Base` class, which this is not. Figured this was a reasonable first pass!
I'm also not a fan of relying on `PredicateBuilder`, that class is going to go under some major changes as soon as `4-2-stable` is branched, we should avoid giving it additional dependencies. Let's use the relevant methods provided by `Relation`, or pull out a common class instead.