Base changes

This lays the groundwork for the new JHM implementation (PR for that shortly).

Adds / cleans up a number of different utility functions in \<base>
Can't you just give free() as the explicit deleter function in the unique_ptr<> ctor?