Added MEX file that replicates computeAverages functionality
Minor fixes to MAT/MEX computeAverages
Moved MEX version of computeAverages over .m files to make MEX/MAT transition seamless.