Prevent duplicate autogenerated IDs

IDs are generated by the text of the headlines. If two different headlines contained the same text, this could lead to duplicate IDs. To prevent this a running index is appended to the IDs.