Add comments and logging.

Added some comments, and added useful logging.

Signed-off-by: Ryu Ishimoto <ryu@midokura.com>