Python 3 fix

This makes all internals in `util` use `unicode` instead of byte strings, so that everything works on both Python 2 and 3. Since the `Statement` object encodes strings in `format`, the outputs stay as byte strings, maintaining backward compatibility.

I would probably recommend using `from __future__ import unicode_literals` in all modules using literals so that things are less likely to break in the future. It’s not necessary now though.

I also added a feature detection in `db` so that tests can run on Python 3 (which does not have `izip`).