Mantis #3734

Changed ToLower() and ToUpper() to their invariant version on string comparisons to avoid culutre problems when dealing with file names or fixed strings. When not used for comparision I added CultureInfo.CurrentCulture to these functions.