Initial metastrategy implementation
Refactored driver code for problem solver

Having written it badly once, I knew what I was doing and could rewrite
it reasonably.  It’s a lot clearer now and probably has fixed some bugs.