Revert "Resource manager"

This reverts commit 176dd193f9896f21e5845b7dad4d3f2f78b43ad1.
Revert "Revert "Resource manager""

This reverts commit 3f04000fed09053949122bc598b83a3b21ca0c48.
Resource management

PERKELE code vanished so had to write it again. FML.. So started
resource management, no idea (some idea) what it does actually but its
there and it builds without errors soo im good right?