Add basic PL/pgSQL function to create intersection table

This script currently only creates intersections for treenodes that are on
individual slices of a XY aligned stack.