Optimize layer handling in view transitioner

This also fixes focusable mount issues
Move css helpers to separate file