Add equals, canEqual, and hashCode methods to MdTag class

Also adds a simple test of these methods.