modernized a lot of code, added pointer-check SAL

added `_Must_inspect_result_` to literally every pointer-returning
function, cleaned up a bunch of ugly C++98 & C++03 code. Tracked down a
few bugs with Application Verifier.
Goddamnit. I missed one.