Add scoped_map. Cache type checker results.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>