Wip/windows service

@laguiz , I rebased your changes and fixed some compilation errors. Feel free to
fork from this branch (I'll close this PR if you can continue your work).