(Frontend) Move more platform-specific code into environment_get function
implementations