Consolidate various Python 2/3 compatibility tests in pyrseas.lib.pycompat.

   pyrseas/lib/pycompat.py: Defines PY2 and strtypes.  PY2 is used to
   normalize various tests for Python 2.x.  strtypes is moved from
   pyrseas/dbobject/function.py so that it can be used elsewhere.

   Note: This breaks the autodoc and pagila functional tests under
   Python 2.x, due to use of yaml.safe_dump in change 1e4fa91.