Add generalised memory-management functions.
Free context-bound objects in reverse the order they are allocated.

This is generally more intuitive behaviour, and matches, eg, C++ destructors.