Factored out common code
Added test for type checking of dictionary comprehension
Added type checking for dictionary comprehensions