Support reference uri & fix gobs of C code

I think argc and argv are poor choices for the parameter names here? Can you provide something better?