more efficient per atom energy and virial support
include code contributed by stan moore with some additional preprocessing and whitespace cleanups.