Fix parsing of resource references
Fix handling of remote resource references

Remote resource references (fetched from the PuppetDB API) are stored as
a single string. This patch handles their transformations into proper
resource references.

It might not be a good idea to do that at such a late stage however.