Migrate cli code into pycsync script