Adding support for memory spilling, sorting priority map.
Added allocation and running for memstore test.