Merge "Move tun functions to a new tun.c."