Fix warnings on MSVC
Most of the warnings are about using "unsafe" functions. In addition to replacing string functions like strcpy with counting strncpy versions, which makes sense, older MSVC versions for some reason don't support POSIX versions of these functions. Instead, they have their weird offshoots, which is a pain.
Showing with 135 additions and 51 deletions