Improve code generator.

Add conditional if-else-endif. Clean up the code generator code.
Cannot use args in conditionals.

args does not evaluate to a sequence but it is a string representation
of a sequence.
Restructure Formatter.
Use own indent() function.