Applied my dynatree fixes to this source and reverted dynatree

After a conversation with the author of dynatree, I decided to just
roll my dynatree fixes into this source.  He has moved onto a brand new
version of dynatree and doesn't want to make changes to the dynatree
souce.  Therefore, it is likely that my patch will not get applied to
dynatree.  I leave it here for posterity though.