Filter can be array or lambda.

Mohamad, here are a few of the API changes I suggested on [codereview](http://codereview.stackexchange.com/q/49469/10084).