Refactor windows_service_manager slightly so that we can reuse it in dif...

...ferent projects.