Building a whole layout tree shouldn't be a concern of Node, so this patch moves it to a separate class.