Fix #46: Replace problematic save path characters.

Add function to replace certain characters in a string (strreplace).
Replace problematic characters in file names. These are primarily a problem on windows platforms, but also other platforms using for example the FAT file system.