Base: Improve and consolidate OS detection