Checks if two javascript objects have the same keys and properties