Docs: Code review complete for this file.
Fix: Disconnect the exit timer in the main loop for safety.
     Call exit method instead of quit slot.
Fix: Use startswith instead of equality comparison.
Fix: Disconnect correct signal.
Fix: Typo in regexp refactor.
Fix: Modify _processPendingEvents to use a separate event loop, not the application's loop.
     Also add safety code to better clean up after exiting the loop.
Fix: All but one test passes. Clean up helper routines, use an improved _assertHtmlReady.
Fix: manually reload Markdown templates since dock is already open (load happens by default in the dock constructor).
Clean: Clean up comments, remove redundant code.