Add equal? function

Useful for unit testing.