Added mergeOnAdd option. Added merge function to models.