Rename test codes
Add compatibility utilities and support py3
Use assertEqual instead of assertEquals