Support fay 0.20

This turned into quite the CPP adventure, but it works on both 0.19 and 0.20.

Hopefully the new interface is a bit simpler.