Here is a demo
There is room for improvement. I’ve noticed one issue while testing. Blaze could not handle <content select="*"></content> tags.
For eg
<!-- test-layout.html -->
<dom-module id="test-layout">
<template>
<div class="title">
<content select="h1"></content>
</div>
<content select="*"></content>
</template>
</dom-module>
<!-- main.blaze.html -->
...
<test-layout>
<h1>hai</h1>
<div>!!!</div>
</test-layout>
...
<!-- Expected Result in browser-->
<test-layout>
<div class="title"><h1>hai</h1></div>
<div>!!!</div>
</test-layout>
<!-- Actual Result -->
<test-layout>
<div class="title"></div>
<h1>hai</h1>
<div>!!!</div>
</test-layout>