Compare with == first, faster and respects __eq

Fixes the issue of tables with a custom __eq defined
not being compared properly.
Use a faster approach for comparing tables.

First make sure that both tables contains all the same
keys before spending time doing value equality checks
on the contained values.