Copy over PlatformModeDetector from ReactiveUI and clean it up