Added a $limit option to find_replace_templatesets

Some plugins need to set a limitation on the number of possible replacements in a template, imagine you want to add a script right after some "< /script>" tag, and your template contains two or more of those "< /script>" tags, if you don't specify a limitation, you will get your string inserted twice. A more serious issue happened to me when I tried to replace a whole template (using /.*/s), the replacement got inserted twice, because preg_replace considered even the empty string as a match, I replaced it with /.+/s (one character at least) as a workaround, but it's still not what I wanted to do, because I DO want to allow empty templates to be replaced too, along the non-empty templates, but I want to limit that to ONE remplacement only.