Update the battery example to match the spec

Uses the `navigator.getBattery()` promise when available instead of the deprecated `navigator.battery`