The big merge of HQ Accounting's feature branch into master

All the commits in here have previously been PRed. Here is one last final review