Contour lines close along the border

I included Jason's code for the "cliff edge" to force contour lines to close along the border plus a minor addition to compute the cliff size based on the data in the array. I hope this is useful. Thank you Jason for conrec.js.