make test code python3 compatible, and fix travis issues