Fix to drawing algorithm

* contour() could return a separation that was negative, leading to odd
layout of some trees.
* Some minor tweaks to assist in debugging SVG output