I can address the high level concern. I will let the others address the specifics in the code. The high level goal of this code is to enable the VM to not assume a UI, or even a specific UI. This is important for enabling other user interface technologies.
The Windows part does not work yet. However, the goal of this branch is to integrate it now to not lose the work. The Windows support will be added later.