Python 2 support

Just a pile'o'ifdefs. The big changes are handling python 2's pluralistic
string classes, and supporting the non-long integer type.

Signed-off-by: Casey Dahlin <casey.dahlin@gmail.com>