Added simple routine to calculate avg. energy of last electron, To be used for XCH on bulk systems.
Not tested for spin.