Do not register dihedral partners when it is an improper torsion.

Replace Atom == Atom with Atom is Atom.

Fix another small bug in determining same_atoms between two Improper's.
Add some unit tests for the topologyobjects.