Add a limit to the number of directives Reviewed-by: kvn
Stress tests for directive parser Reviewed-by: iignatyev, neliasso