Added escape and unescape functions and their tests