Break the compositing -> layout dependency

Clean up code duplication in Pipeline creation.