Speep up epsg lookup, thus boosting significantly the tests (but also normal operation)

Backport of #460.