This is the bare minimum proposed fix for #45
By using a nested map the way I do in this PR we could also simplify the
logic further down where we look for matching direction.Up or
direction.Down migrations.
Added a unit test to demonstrate the problem in issue #45
The introduced makeFiles() function could be used to simplify the other
tests too, but I didn't touch more than necessary for this commit.