docstring updates
added backwards compatability for python 2, changed post encoding and modified tests