Port away from deprecated API
This is an old patch form phabricator, a bit mixed with general modernizations. I can split it if you want though.
Edited by Jonah Brüchert
This is an old patch form phabricator, a bit mixed with general modernizations. I can split it if you want though.