Change all instances of isnan() and isinf() to std:: namespace

This was necessary for compilation with C++11 on my Windows machine, just as moving isfinite() to std:: was necessary in the past (for Macs from memory).