Adding trotListRefCompare
Misc changes

Main change is we make sure lists can have no more than TROT_MAX_CHILDREN children.
Various other cleanup of code.