Coding style fix.
Fixes a locator generation bug and moves polyfills to a separate file.

This bug happens when the `class` HTML property contains more than one
consecutive spaces or a trailing space.
Merge pull request #36 from tamasd/master

Fixes a locator generation bug and moves polyfills to a separate file.