Improved echo server example.