New pattern matching keywords in Collections

This replaces pull request #1751. This is for issue #1724.