Add UI and scripting support to embedded queries

Also adding my +1. Thanks!