fix type-casting in surface sorting, update comments
adjust trnode/bvnode insertion algorithm for greater flexibility