Add proper 'end' function

Adds `end` so that both test examples and descriptions can be more clearly defined.

I still want to update the documentation before this is merged, but otherwise this is good to go.

@locochris what do you think?