removed unnecessary require statement
Added safe encodeURIComponent to eliminate errors on malformed captures.

Moved decodeURIComponent wrapper function into utils

Added test for malformed URI param extraction support (#1735)