More ClassGenerator work

Better using collision avoidance
Added support for constants.