cleanup, documentation, movement of awkward hasattr calls to dendroutils.py to handle differences in DP3 and 4