closes #289 with performance improvement to replaceall()