Add reassignMemory kernel function

Changes the owner of a block of memory.
Refactor allocation in favor of reassignMem