Implement the ~ syntax for encoding JSON Pointers