various functionality and tests added according to plan
SOC calculations, Phosphorous, a bit of refactoring