Fix css/media directive splitting to match expected behavour
Rewrite lambda functions as class methods