Come to think of it, this library could be a standalone package because it is useful outside of the runtime....