Compositor clean up

Reorder layer tree construction, implement layer occlusion, and general clean up.