Major refactoring of the waypoint code. The new design fits the model-view-controller pattern better.