Added the option to get the text matches as an iterator instead of an
array.
Reshuffled the GUI code so that it's more obvious which parts of the
code do what.