CSS compat stuff, JS cleanup