Restructure compositor layers to work with iframes.

When a frame is selected via set_ids, a tree of root compositor layers is
also created, matching the tree of pipelines in the frame. This
decouples the chronological ordering dependency for parent frames and child iframes when they
send CreateOrUpdateRootLayer & CreateOrUpdateDescendentLayer
messages.

Gotchas:
* iframes dont render when using the -o option (the compositor doesnt
  wait for the child iframe to render before exiting).
* layout task or script task failure on exit ("task * failed at sending on a
  closed channel"), this happens if the child iframe
  shares the same script task as the parent and can be avoided by adding
  the sandbox attribute to the iframe.

@pcwalton & @mrobinson
Changed the min calls to cmp::min. I tried removing "use std;" + changing min -> "std::cmp::min" and the compile fails. Not sure why (compiling a simple test.rs file that calls std::cmp::min without "use std;" works fine).