Add support for resources by name

This is quite a large PR. Please use as a basis for discussion.
see commit message for e25e7f9