Parse TOC (NCX file), plus a few small improvements