Fix URI validation.

The regular expression relies on anchoring, but due to the lack of grouping, these were only
being applied to the first and last options. Additionally, InvalidArgumentException was
being referenced relatively in realSetPath().
Merge pull request #1 from nick-jones/fix.path.validation

Fix URI validation