merge code into _setup.py, add test.py