CLI: Support a maxErrors option to limit the number of reported errors

Closes gh-664
Fixes #238