Support reference uri & fix gobs of C code

I can try to switch to a ruby hash for the optional args. I think that'd be clearer but the argc/argv idiom unfortunately is specified by the ruby variadic function API so we're kinda stuck. But I'm adding comments now to hope it helps!