Hooks

One thing that makes debugging hook scripts really unfriendly is that it's impossible to capture input and output of the user's script here in some fashion - it's fine to leave this as is for now, but there should be a JIRA ticket pointing out this problem. (To get my little tracer script working, I had to add code here that printed inputoutput into files)