The big consumer/transformer/writer refactor

Don't think it's the IDE - I dropped in a new file here with the same name as the previous. Had to merge things manually and missed the header. Will add a new commit.