A number of updates to handle JSON examples and authored examples.
PEP8 and pyflakes cleanup.
Use a unique ID when registering the event handlers.