Javascript optimization and css transforms