More hooks

- pre and post socket commands with socket + arguments
- open and close database hooks with filename