Port latest batch of cukes from master to gh

:warning: This is my work in progress; some cukes still fail

/cc @jingweno
I can also merge it as-is and we could look into how to optimize this code later.