Move windowing code out of compositor, take 2

This includes the previously-reviewed commits from #3533, plus additional fixes for test failures, and a workaround for CEF link errors on Mac (related to rust-lang/rust#14344).  Opening a new PR because this required a fairly invasive rebase, and the original was polluted by a bunch of test commits. r? @larsbergstrom