From this post on StackOverflow.com, I learned that: "In PhantomJS (and thus also CasperJS), evaluate runs in a jailed environment. Only primitive objects, something you can
serialize via JSON.stringify and JSON.parse is accepted."
I struggled to find a work-around until I thought about using underlying PhantomJs API which Casperjs exposes via .page class.
Bingo! From within casper.thenOpen call, using this.page.evaluate I was able to access 'gen' object as a property of 'window' object and return it back
to my casperjs code: