Raise URI::InvalidURIError if wrong uri.

Until we implement our own parser, raise URI::InvalidURIError  when gid is incorrect
Flip the order of these methods, since set_ is used first. initialize should read like a table of contents, and the chapters should arrive in that order.