Lots of changes to mtpipeline.py to address issue #18 as well as associated tests.