Optimize CSS Export: extract similar rules into combining CSS block

Tests are pending… Comments are welcome.
Despite weird ECMA rules, i should be declared here again for consistent code. So `var i`