Injecting external QueryBuilders into Entity sources

A clean PR to replace #410