Improve before/after annotations

This adds possibility to add more methods to the `before` and `after` annotations. See the updated documentation for how it works.