Handle extra whitespace in className

Browsers don't guarantee a single whitespace between classnames, so without any normalizing or trimming it's possible to end up with selectors like `..some...class.`

The `getClassNames` function intends to always give back an array of valid classnames.