add a higher-level API for IORefs and MVars

These functions help refactor the DevelMain.hs file into something a little nicer.

I don't like the module name of Base, but I couldn't think of anything better.