incorporate the fix for http://bugzilla.fcdonders.nl/show_bug.cgi?id=2059 in the release version

I have added a test script, a helper function for comparing figures and fixed ft_prepare_layout so that it performs channel selection when the input contains a cfg.layout as structure.

Furthermore (potential risk for side effects!) I have renamed the variable lay into layout in ft_prepare_layout using search-and-replace.