Cleaned up file writing code

Now has a file writing .vi to put x and y data into a file with the x
and y precision selected by the controls.