Moving python stuff into separate library