Factored out code generation for isDefined and ifDefinedOtherwise

- DRY is better
- Now it can be re-used in code generation for ?= and isDefined
Assignable
Implemented ifDefinedOrDefault Assignable and ?= Assignment.