Test toolkits rebase

A rebase of #2135 on master which is in it self a rebase of #1422

It still needs some testing. So please hold back merging.