Fix URI regex to be javascript compatible.

Regex taken from http://jmrware.com/articles/2009/uri_regexp/URI_regex.html
Added test for uri.