updating script to work in Windows (thanks @rtibbles); making platform-specific utility file to centralize platform-based logic.