Improved logging in the example script

- Add --verbose option to enable DEBUG logging.

- Add timestamp and log level to the output format.

Change-Id: I11ca42095d7ee24782d39141fae20b8b26695fff
Fix #5: Move json parsing and error handling into the event factory

Pass the raw string into the event factory and parse it to a json
object there.  If the string is not valid json, generate an error
event.

Add a unit test for handling of invalid json on the event stream.

Change-Id: I209a89fd28c3a594b71443fc106e25d58c5cc1ea