Debug hooks

Improving testability / adding acceptance tests
Will fix