Added memory.h/.c with macros that wrap memory allocations.

The memory macros track allocations and deallocations when the
SITEGEN_MEMORY macro is defined.