NF: add restructured text formatter
RF: another couple of specific open file modes
RF: guard against nasty comparison difference py2

Code is using Python 3-specific type error when comparing lists to an
integer.  Make code explicit.