Bug fix: clearing dictionary properly; get rid of all impossible movements

While attempting to deal with rests at the beginning of a piece, contents of a loop were incorrectly judged to be merge-able into the previous loop. This had the effect that empty dictionary entries inside the final iteration of 'movementsAB' (indicating impossible solution) were not cleared properly, leading to errors when (random) sampling the progression.