Change term equality tests to check for equivalent hashes first, this should improve has_statement? and therefore graph insertion performance.