Add ANY-OF and ALL-OF functions

See http://issue.cc/r3/637 for details.