Added compare function to Object class.

Added a simple compare method to the Object class, which simply
compares their memory addresses.