more modularization
UDP communications simplified significantly
fix doctests and some warnings