Allow spaces in grep arguments

The current argument parsing isn't quite correct, and won't allow spaces in grep arguments.

One caveat with this fix is that I use Array::reduce in adapter.js. Does it need to be ES3 compatible?

Also includes some minor chores.