Fixed bugs in query param and cookie processing

1. Used regexp capture to extract cookie value to avoid splitting
on base64 encoded trailers

2. Decode escaped URL values (quick hack by replacing % with \x
then passing the result to String.unescape)

Also, where possible replaced Regexp.split with String.toArray.
Hopefully for speed.