Fix typo prestine -> pristine
Implementation of selector.last

We are still not compiling queries, but that's okay for now.
scopes can take a lambda
Default value of fields accept procs