Simplified some macros
Added reference PDFs and test script
Fixing some tests
Revert hack for listtotal
Minor doc typo