Use unicode in all internals

Makes the whole thing compatible to Python 3.

Also added a feature detection to db.py so that the tests run on
Python 3 (which does not have izip).

Fix #37.