I have been experimenting along these lines, by making a scripting interface to Linux that lets you do the basic stuff that you need to bring up a VM/container/hardware [1], This includes bringing up networks, configuring addresses and routing. There is a lot to do (still need iptables), but you end up with a script over Linux that configures it, using a scripting language and ffi, which you can compile into a single binary and eg run as your init process. Linux is a pretty decent API if you wrap some scripting around it rather than a lot of C libraries and shell scripts.
You do not of course end up with a standardised interface from this, as it is dependent on the Linux environment you are running in (although a VM can standardise this). So I am also experimenting with userspace OS components, like the NetBSD rump kernel [2] in the same framework.
Also helping here is the shift (gradually) from applications (like web servers) to libraries that you can link in to your application, or full scripting inside (like openresty for Nginx), which addresses your bundling issue. If you are building single function applications that are then structured into larger distributed applications this is much simpler.
You do not of course end up with a standardised interface from this, as it is dependent on the Linux environment you are running in (although a VM can standardise this). So I am also experimenting with userspace OS components, like the NetBSD rump kernel [2] in the same framework.
Also helping here is the shift (gradually) from applications (like web servers) to libraries that you can link in to your application, or full scripting inside (like openresty for Nginx), which addresses your bundling issue. If you are building single function applications that are then structured into larger distributed applications this is much simpler.
[1] https://github.com/justincormack/ljsyscall [2] http://www.netbsd.org/docs/rump/