Adds escapeRegExp and fixes documentation