Optimize import function and add field comparison function.

Import function is now an import class, and includes a cache.
The import now takes around 1/5 as long.