Add more top-level statistics

- Prefix memory pool statistics with 'mem_' to help distinguish them.

- Refactor code slightly.