Initial IDA* implementation. Proof-of-concept, code to be tidied up.