allow user to specify libdir in saveWidget.

This PR allows a user to specify libdir explicitly, while using `selfcontained = FALSE`. This is useful when creating a directory of examples, allowing them to share dependencies.