Outputting rows to separate files in a directory

Changes the loop to output files to a directory rather than the one file. It would be good to make this dynamic (listen for options in the client gruntfile) so it can potentially merged back in the main repo.