Added ability to switch between "IN" and "Exists" semantics. Fixed some ...

...logical errors in code generation.

Signed-off-by: Aaron Rosenzweig <aaron@chatnbike.com>