Initial changes for Shard-Query custom functions.  Many tests fail, will investigate