Refactored tokenizing into paragraphs and words.
Cleaner and more conventionny main function.