[Closes #29, closes #28, closes #12] Fixed several bugs and implemented CSV export