Fixed logSumExp to correctly handle NaN and Inf
Added computation of likelihood under old grammar when doing breadth-first enumeration in EM
Implemented optimized version of canUnify. Profiling indicated that this procedure was taking up the majority of the run time.