Refactoring of fragment/fragment interaction routines.

Move calculation of fragment/fragment interactions to a single place.
This allows us to store overlap integrals only for current pair of
fragments and removes duplicate code in several places.