Creating resourceloader.js, factory class for loading and keeping track of already loaded materials