This patch fixes bug 731519. The fix sets the upper limit before it sets the value of the end row spin button.
Part Bug fix for 729476, this fixes the quoting of quotes, newlines and separator to make it more compatible with CSV format.
Part Bug fix for 729476, this changes the line endings to \r\n to make it more compatible with CSV format.
This patch just changes the white space to be of a consistent format.
Refactor OS-specific ifdef to reduce code duplication

Which results in reduced risk on typos in either branch
CSV Export: factor out function to generate regular expression
CSV Import transform macro into function

A complex macro is difficult to debug, particularly if it uses
variables that were defined outside of the macro.
Rework assistant csv import regex code to eliminate the mandatory dummy field (#eol).

This consists of a couple of changes that are heavily interdependent:
- read the csv file entirely in one string
- tweak the regex so it knows the difference between the end of line and a newline in one of the fields
- leverage the g_regex code to iterate over the full string directly