Writes lookups
Mostly refactoring to reduce ridiculously nested badly named namespaces.