rough port of rtf reader to python 3 (no longer works with python 2)