Refactor SimpleQueryParser settings into separate Settings class, add "lenient" option

Fixes #5011