Merge "Refactor PlatformCompat and related files."