Excel export

Some changes from this PR https://github.com/concrete5/concrete5/pull/1807/ and another bugfix.
Having started to work on this file makes me wonder if we shouldn't rewrite it from the ground up, the code is pretty messy and creating a proper excel file would have some advantages as well, but we'd need an additional library and concrete5.7 is already pretty big.. Any thoughts before I spend more time on this file?