Multiple code changes, some bug fixes

to do: bi-directional communication
fix timing issues
logging
configuration script
input from client to server
poll from server