Update the table of contents

It's not perfect nor done yet, but it's a lot better and organised than it was.
Please note that now there are also HTML comments which provide a topic list for almost every chapter.