Flesh out wp_memory.w module

This module represents the memory diagnostic routines of tegen. It
primarly consists of wrappers around malloc and free.

- Add wp_memory_initialize and wp_memory_terminate calls to
  tegen.w:main
- Completely re-work the wp_memory module
  - Add documentation
  - Add declaration and implementation of all memory functions
- Improve memory transaction log
  - Now a circular, doubly-linked list
  - Change wp_memory_terminate method to be slightly more intelligent
  - Allocate wp_txn_head during initialization rather than first call to
    wp_malloc_wrapper
  - Rearranged program flow (but it's not perfect, needs some
    reordering)
  - This code has not been tested :-/