support functions in select-list on queries that do pk lookups

Also made the ESGetTask standalone so it doesn't require an additional
MergeTask.

In addition the plan for insert from query has changed so that it will always
use QueryAndFetch to avoid handler round-trips.
think we have a constant ``NO_LIMIT=-1`` somewhere, check for ``!= null`` to be safe here.