Separate the DOM and layout into separate crates.

r? @metajack