Some refactoring to allow for properly parsing tagsoup.

`read_text` is no longer recursive; instead it maintains a stack of nodes,
always pushing new nodes into the one at the top of the stack.  This will
allow to close early some nodes, i.e.

    <table>
      <tr>
        <td>Foo
      <tr>

The last <tr> should trigger close on both the <td> and the first <tr>.
That's still TODO.