fixes #172 Moved memarena to util, made its public API more consistent with
the rest of the code