m4 Create resourceLoaders

Added resource loaders. Now resource code is simpler and has less dependencies