Update examples when a library is added or removed

fixes issue #1909