CalcAvgLib changes

refactoring some code to be less ugly & gross; more for:eachs. All
analytic bugs should now be fixed!