req.contextMenu can be a function; if it is a function it will be invoked with 'req' and must return a context menu array