Separate IO from main algorithm to spoonerize sentences