Cleanup memory allocation calls to use macros defined in new mem.h header. This new header will handle configuration of both memory allocator to use, and memory profiling.