Fix dihedral equality detection and improve the logic in that part of the code
in general. Should be robust now. This also eliminates some duplicate parameters
that are dumped to an frcmod file from ParmEd. Update the saved frcmod file with
the new output (I verified that all terms that were deleted appeared in their
reordered form elsewhere in the frcmod and were equal).

Thanks to Jeff Thompson from UT Austin for the report and diagnosis!