Adding predicate support, ala @jmahonin's fork.

Ideally I would like to use the LINQ-style query syntax, but this will have to work for the first pass.