Cleaned up the code, UAC automatic switching now works

The program is stable, but uses alot of CPU. I have to add some async
and thread sleep functions to tame activity. There is alot of busy
waiting with no work to do.