Centralize the explicit summation / integration

A utility function trace_over_expr has been added to the fock.py module
to centralize the operation of explicit summation over dummy variables.
The previous duplicated code in cob.py and amexpr.py has been merged
here together in a way that is more elegant that it was before.