Merge pull request #15 from norrislee/master

added nested aggregate
Merge pull request #16 from norrislee/master

fixed queries in report.php and table-handling in function.php to handle...
changes in purchasepen to remove max pop