I modularized the excel function a little more. Most interaction should be done from the toExcel() function in excelFunction.php