Add support for do..while.
Clean up code generation a bit.