codecgen: clean up and optimize generated code
codecgen: clean up and optimize generated code

consolidate CodecEncodeSelf into one if-branch (for ti.toArray)

    Currently, we run multiple "if ti.toArray" branches,
    so that we can use labels to jump.

    We now just create a single if-branch.

    For checking if a value is nil, we construct the if-line
    dynamically, and use a slice to reference it as needed.

clean up generated code: eliminate "true && " "if false {" redundant blocks

    Use a helper function to handle if clauses so they are fully formed.

ugorji/go,ugorji/go,ugorji/go