This is basically a 1:1 port (+some fixes relating to incorrect signal emissions and many more tests)