Added encoding and decoding methods to RPTokenControl.