Re-implement base url parsing

Attach metadata to root nodes and pass it down when walking child nodes.