Refactor compositor to use messages rather than callbacks

Replaces https://github.com/mozilla/servo/pull/520 so we don't have to go through the pain of rebasing it.
r? @pcwalton