Updates for MSVC Compilation

Mostly casting, some variable name changes.
Unfortunately, I can't build filemq_selftest due to some linker errors, so I can't verify that this doesn't break anything. I think the only questionable item in here is using _stricmp instead of strcasecmp which was done on the advice of [this SO answer](http://stackoverflow.com/a/7248602).