Refac the code to get a python package

Add a setup.py and reorganize code to get python package