py3 support patch 1

I have fixed the bugs #34  and #35  and made few additonal changes to ensure that all the tests(both offline and online) pass in py26, py27, py33, and py34.