Service OS flavour for mocking/unittests

Refactor code that determines the OS flavour to allow mocking