Hook refactoring plus suite hook fixes
Created by: myronmarston
This is some refactoring and improvements I had done during my initial implementation of #1749 but since that's not going to get merged soon I thought it worth putting this into its own PR.