ncm-accounts: add is_user_or_group function and 2 types defined_user and defined_group

This replaces PR #122