(CFACT-59) Add id and gid facts

In C++ (since C++11), we should favor using `nullptr` over `NULL` (or simply `!pwd_ptr`) since the former actually has a type associated with it while `NULL` is always just 0.  It doesn't really matter here, but generally NULL isn't used in the cfacter sources.