waypoints2.cpp - Significant update/rewrite

The behaviour of the code is now different, preparing it for
communications with PHP through a web interface. The idea is that PHP
will be able to call certain functions, namely userStateControl and
reloadWaypoints. See the documentation on the main function for details.
Additionally, tidied up the code a lot, added/changed comments, etc.
Still untested, so more updates to come.