Attribute escape functions / Implemented escape functions as NIFs

Added escape/unescape functions for attributes
Implemented attribute and cdata escape/unescape functions as NIFs