The NTP reference implementation, refactored
