Back-ported several extensions from next

We don't use these yet, but they shall be used projec-wide, so here they
are!