mutex for h.Process mutation to prevent data races
flag for debug logging rather than const
remove most unnecessary sleeps from tests
remove last sleep in test path