Using require to load resources, added assets, handling require error correctly (without undef)