Break the compositing -> layout dependency

Break the compositing -> layout dependency

Also clean up code duplication in Pipeline while we're at it