added cache

... and loaderFunction is now passed to createEntity
misc