fixed URL and JS escape functions. Added passed unit test cases to escape-test.js