Add AUTO_REPLICATE_EVENTS function for Generate
Merge pull request #3 from MengZhang/develop

Develop pull request from meng