Adding the ability for the forge API to make URLs that have the correct ...

...protocol as it corresponds to the module's repository publish config (in its distributor).

Also added a unit tests for a missing code path where gdbm.open fails, and shortened some long lines.