* Improved tests for str.replace
 * Re-implemented str.replace() to avoid infinite loops and properly support count