Fixed invalid h0 header tags

Changed the way bookmark tags are created to a more robust method.

The algorithm is no longer dependent on level 1 heading (the previous
one caused problems if the first heading was not a level 1 heading).