csv output and command line interface; closes #3