Parse network related variables in cmdline options and add hostname fallback function

These commits add functions to parse network related variables from Kernel cmdline options (e.g. `var=%{hostname}`) and a bare-bones implementation for hostname, in case the executable is not available.