WIP of adding marching squares feature to Tiling demo et al. (something wrong with cleanup, and otherwise overlooking some detail... worked in material I'm adapting this from)