Better support for embedding

In particular, beyond the convenience methods, allow adding the shutdown
hook to clients doing the embedding.

For clients who don't like defaults, also offer a more granular
interface.

Warning: untested yet.