It was in large part copied and pasted from fc-solve's make_pysol_freecell_board.py and from other sources, so there may be a lot of ugliness due to me (= Shlomi Fish). But I'm using it to bootstrap the change in the ms_deals.