A JavaScript implementation of the Battery Status Events draft