Prepare for distribution on PyPi, implement tests