More commits in one MR than usual, but the implementations are quite short, and it's good to get them all in at once.