ENH Rework BTEncoder to allow subclasses to be encoded; reorder bencode.py