Portability and bugfixes

I started this pull request from my master because I had to resolve a small conflict. The commit details from dcef387 show the different changes. Let me know if you have any questions. I've confirmed that the nickname,otname,etc parsing works on the Pokemon Black save you sent to me with both GCC and MSVC.