Serialize objects into JavaScript source that re-creates them from their constructor