Core: Improve id escaping, store escaped id in describedby

Ref #1275
Fixes #1269
Closes #1273