fix exec method to stringify/parse full js objects (including function definitions with strings etc.)