Refactored loop()

- splitted loop() code into several internal functions, in order to
keep as most as possible a unique abstraction level
- defined sensor string field separator as a constant (in
defs.h)