add telnet echo.
remove double include.
add a few cmake checks for functionality.