Make Battery.Percent value's type consistent and always int; and some other random code quality fixes.
int
CC @alex @ngraham