Re-work the core buildsystem

There are now scripts in tools/ that take care of all the magic of
building the heap and the executables.  The Makefile does very little,
and there are no more random make_heap.ML/make_bin.ML files with
hardcoded paths (all the paths are in the Makefile).
Put MatchSearch back in the GRAPHICAL_THEORY signature

Turns out QuantoCosy needs it.