Implement Path.prototype.{shift,unshift,push,pop}.