moved main functions into __init__.py and also moved tests into directory