More robust character escaping

Replaced character escaping method with
[`CSS.escape`](https://github.com/mathiasbynens/CSS.escape) for more
robust character escaping.