Move some LexEntry domain logic from FdoUi into FDO

FdoUi is not getting distributed with FDO, so we need the necessary
domain logic in FDO.  In this case, some of the lexical lookup logic
was integrated with the UI code.

Change-Id: I9d938db428d498d8011fb35ba81063ae55f5de86