Refactors high level resource loading code. Fixes warnings on MSVC.