add more unit test for codegen.py
modify examples in prepration for python3 support
remove all implicit relative imports in prepartion for python3 support