closureOf function and related tests
implement Heath-join and add necessary dependencies