Refactoring of the lookup module and tests.
Added tests for dictionaries.