Rewrote type lookup to support import and generics