Add option 'container' to support other containers than default window

This allows you to specify a different container of the default 'document'.