Step 1 of code refactoring

Refactored code into the SequenceParser, SequenceSampler and
FilenameHolder portions for script 1 and 2, to make executing the
script in a "master script" easier.