Make asPrimitiveId a static method
Remove unless code to prevent custom DBObject to be checked

Hack to prevent DBObject to be checked has been removed in a previous
commit 4d12b35