Add isEmpty test for objects (from UnderscoreJS)

+ Compare objects only if their ID is equal (or both undefined)