Enhance class matching to accept space-separated list or array

Previously class matching was happening by simple equality checking. This update allows `options.class` to be (or return) either a space-separated string or an array of strings. Also adds a test for both of these.
could this be changed to:

```javascript
val = Array.isArray(val) ? val :
  val ? val.toString().split(/\s+/) :
  []
```