Fixes bug 890942 - Added a service to run custom queries.

@peterbe r?