Add some debug logging.
Make a start on testing the app code.