When name-mangling for the sake of looking for unique atom types, make sure to
add two indexes to ensure that the atom type will not accidentally match a
different atom type that is not name-mangled.

Also simplify the same_atoms function call by eliminating the 'improper'
argument and simply determining whether an improper torsion should be tested for
by looking at the nature of the torsion being compared.