Fix code format
Make a simple functional test program
Fix import to work in py3