Do ASN lookups in the framework as efficiently as possible, and rewrite tests to use this.