Remember workbench state (take 2)

In the interest of getting this in, I rewrote the two functions as per @dchambers comments. It's all the same stuff, with a new commit added (I wanted to re-open the original one, but it seems I can't).