remote: [hooks] rename consolidate hook functions

- `addHook` => `hook`
- `prepareHook` => `_hook`
- replace all uses of `prepareHook`
- slight refactoring of tests
- comments
Merge branch 'refactor/hooks'