Re-define nil as nullptr, cleaning up some potential issues along the way

With nil defined as 0, there were several parts of the code that were using nil incorrectly...  And with plKey's "nil" constructor taking a void*, there were a few places where a random pointer was being accepted as a valid constructor argument, even though they shouldn't have (and would have caused an assert at runtime anyway).  Using nullptr makes these types of misuse compile-time errors.