Adding doc.select_related()
Fix problems with ID 0.
Using mongoengine's metaclasses for better compatibility. More unit test fixes.