Added as_plaintext flag to Encode

This is what I was trying to do in 267ac34 and 7b79b70