Windows compilation fixes

Been away a while, noticed a lot of new code.  A few lines broke the windows compilation, mind pulling them in?  Windows requires std::min/max/etc calls to be wrapped in ( ) as they're duplicate macro defs.  Alternate fix is to use a #define NOMINMAX fix, but I already fixed a *lot* of instances by wrapping in parenthesis.