Add receive_data and comments

In main(), wrap receive data and actuate in a while look similar to
Lakshmi's suggestions.
Add logging, actuate, id counter, move str and repr