Generalized `where` clauses

A tracking PR for where clauses. For my own code review and diff view.