Converted many sprintf calls to snprintf.

Converted most of the easy calls of sprintf to snprintf. This is good, because most compilers including MSVC have sprintf deprecated. We have the warnings disabled with the pragmas:
#pragma warning(disable : 4996)

I was concerned that it would slow things down. But I tested it on Windows 8 and Ubuntu, with no difference in CPU or ram utilization.
Also here, there's still a buffer overflow bug.

This is pointless code churn if you aren't going to actually make the code safe.