This all works, and I should commit more often. But mainly, format things a bit nicer - and add support for generating a CSV by user as well as everything else up to now