Move failing parts of lookup_collatename to a separate file instead.

Change-Id: I8f1ce8dcca604e75cd8dbdffe20da9fd8bed1496