add permalinks for comments

work in progress, fixes #2302