MUS-86: Mkdir on MIDI Export, Tests

added function to mkdir if midi folder is not present. Did also do some
small refactoring work on tests