(CFACT-59) Add id and gid facts

Generally I stick to `if (ptr)` or `if (!ptr)` for brevity.  Where `nullptr` really should be used is when passing arguments because its type can be used for correct overload resolution (where as `NULL` could bind to an `int` overload, for example).