[gps2logbook] Major code refactoring