Make register_snippet usable as a decorator

What it says on the tin. Docs and tests included.