Standardize memory allocations

Reviewer: @wilmo119

aim_malloc doesn't return NULL, so there's no need for error handling. Also replaces malloc+memset with aim_zmalloc.