Move definition of SECURITY_WIN32 from makefiles into source.

This makes it easier for people to recompile the source in other
contexts or other makefiles.
Update documentation to refer to Git rather than Subversion.
Report correct error when FormatMessage fails.

Previously, the original error code would be reported as having come
from FormatMessage.  Spotted by GCC [-Wformat-extra-args].
Remove an unused variable.

As far as I can tell, it's been unused ever since it was introduced in
2001.
Add some missing invariants in bigdiv and bigmod.

The underlying function 'bigdivmod' does not ensure either of its
outputs is normalised, so its callers must do so.