Table of contents(index) for epub

The documents can finally be read alongside a TOC, I tested it with a variety of documents before this commit, so I presume it should work with all. Also fixed the part where I had screwed up PDF annotations owing to a wrong call. In the next commit, fully functional searching would be up, using HTML parser of libxml in combination with webkit.

Also some other minor changes.