Add bye function.

This implements the feature requested by #2.