ConTeXt writer: add function toLabel

This function can be used to sanitize reference labels so that
they do not contain any of the illegal characters \#[]",{}%()|= .

Currently only Links have their labels sanitized, because they
are the only Elements that use passed labels.
Merge pull request #1589 from mszep/master

Add function to sanitize ConTeXt labels