added union source
added scoping (for config)
avoid worker crashes on badly scripted plugins
database: upsert function