more unittests and code cleanup
added tox config for py26 and py27