Make editor.py python3-compatible

Write/read tempfile in binary mode to prevent errors when writing bytes
in py3, after encoding.

Also fixed pep257 doc-strings.

Change-Id: Id88e449dd48bd503adbd731746ddec8fd5476a42