Modified bind_to_tree_impl to recognize style element and send it to lay...

...out task via AddStylesheet after parsing it.

Rebase + tests from #1350.