Implement replace and replace_sub to allow for keyword/value/replacement