Improved MEM_delete and completed tests for memory.h.