Ctxq

implements querying of current agents through the context and cleans up a few things