adding SLEEP_FOR as test constant for easier manipulation
busy wait for last_json_message; sleep after sending a message too
fixes #1 - checking if connection is available before trying