RF: add (partial?) python 2 compatibility

Make code somewhat more ugly by adding Python 2 compatibility.

I wasn't able to get the citeproc-test set up properly to test this well.