Set and dictionary comprehension

This PR implements both set and dictionary comprehensions, so it fixes #508 and #461.