Add more memory measurement functions to utils.

Functions to get total system memory, along with functions to get
virtual memory (not just physical). TODO a lot of duplicated code
here...