Change record translate to use a map

Makes lookups O(1) instead of O(n) and a bit easier to read.