updated stats export to allow more user control

The user can now specify the name of the generated .csv and is warned if
they are going to save over a file with the same name.