refactoring the PortalMemory code and adding an interface for random DMA