Implement object/array based hook assignment

Add the #.hook method to instances of model, which provides an API for assign any kind of hook, and allows one to assign hooks using a configuration hash, or using a hook name and an array of methods. Makes all hook methods delegate to #.hook. Add tests for functionality.