Upgrade ngram dumper for debugging
Add macro-enabled debugging to joint_order.
Fix crash when pruning
merge in pruning fix from master