Added cell average

Moved memory allocation to setup_system. Added computation of cell
average which is also saved to avg.plt file.