More refactoring, fixed a bug in state enumeration.  Some decisions seem to be really fast, while others take forever.