Allow for nested whereRelated and orWhereRelated

Signed-off-by: William <william@amovens.com>