[runtime] Extract the remoting code from marshal.c into a separate remoting.c file.