extract a new public replaceTextWith() method out of replaceText() to allow adding objects programmatically

would fix #7.

this is probably poor API design in all sorts of ways. i won't be at all offended if you scrap it and rewrite from scratch, or whatever. :P