Various efficiency improvements for parser training.