Added exception handling so that errors don't immediately close the program
removed call to exit() so that the program always terminates the same
removed pickle dependency, switched to storing last index in text file
fixed extra carriage return bug (csv needs to be opened as binary)