refactored, added process data write

moved battery data gathering to own function, fixed processor top 20%
calc, added writing of process data to file