Improve listImpl

If only JavaScript had quotemeta! In any case, perhaps we should use the most recommended regex on [this StackOverflow question](http://stackoverflow.com/questions/6318710/javascript-equivalent-of-perls-q-e-or-quotemeta) about how to do this.