extract parts of vnstat main to separate functions
move simple calculation related functions to common