Add indicators for PY2 vs. PY3

--HG--
extra : rebase_source : 549637a713aba52da4c87f1a84436832eba82f1e
Remove conditional import for frozenset (available in Python 2.6+)
Use PY3/PY2 indicators to reliably select behavior. Fixes #237

--HG--
extra : amend_source : 33f3d298acd39933ccf60810902feb2a5d51c793
next function and io module are available on Python 2.6
Use the term 'string_types', following the pattern in six

--HG--
extra : amend_source : 3a4aeb2627549c3dfec15067579eccc8e1314de2
Remove execfile compatibility - unnecessary on Python 2.6+

--HG--
extra : amend_source : 8a0dcd07e62a327647c834a44fe73b8ebc7b53b9