support for module install

Reorganized and added setup.py so project can be installed as python module using pip.