Moved memorymanager stuff into main package