Only match valid CSS

Invalid CSS should be ignored
Merge remote-tracking branch 'leith/master'
Add regression test for #10 and make it even more robust