unit tests added, and bugfix for unescape