Updated with a more refined version of removeListener and addListener
that uses hashCode on the Java Method.