#869: allow comprehensions to start with an if clause

Pull in #TODO, #TODO and #TODO as well.

Example code and generated code: https://gist.github.com/lucaswerkmeister/8530183