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

Develop pull request from meng