More use of simplifying macros.
Replace dynamic allocation with automatic storage on the call stack.