Fixes #3516: resource names (domains) are now being parametrized when used to construct urls

This works, but I think a better approach would be to construct resource urls using constant (as in non-editable) ids (such as a db primary key). At the moment a url that uses resource name in it stored outside of Foreman will become invalid when the user modifies the name.