Bugfix: allow for more than one resource of each type
Add support for creating temporary functions