standardize memory allocation functions

Reviewer: @jnealtowns 

The goal is to have all modules use the memory allocation functions from AIM instead of separate macros. Additionally, the new allocation functions abort on failure.