Reworking resource cache, starting to add logging to the engine.