Python 3 changes

Mostly wholly innocuous: changing dict.keys() to list(dict.keys())
in a few places, changing a relative import.  One file requires
two genuine "if this is python 2" checks: first, what to use as
the type of a string ("basestring" in Py2, "str" in Py3); and
second, what the pickle module is called ("cPickle as pickle" in
Py2, "pickle" in Py3).
Merge branch 'master' of github.com:LuminosoInsight/syncstomp