Escape "\" and "$"

To send "$" and "\\" to a repl session. (E.g. R uses "$" as an indexer.)

PS: This is my first pull request. If I missed an important point about how to do this (though I tried to inform myself thoroughly) I’m sorry.