py3k support, closes #15

Nothing particular interesting here. A few more uses of PY3 than I would like, but we can clean that up later.