Make compositor layer creation atomic

Instead of creating, sizing, and setting up layers using several
messages use only one. If the layer already exists, it will be updated
to reflect the new properties. The clip rect is still set in a separate
message, but that will be eliminated in a later commit.
Pass creation/update data for compositor layers in a struct

Use a new LayerProperties struct to hold all the data necessary to
create or update compositor layers. This reduces a lot of duplication
when passing it along.
Merge pull request #2788 from mrobinson/compositor-cleanup

Make compositor layer creation atomic
Move compositor event handling code to a new `events` module

Also, make them free functions rather than static methods on
CompositorData.