In preparation for the inbuilt options parser, this is a minor refactor
of optional components including:
- Putting certain optional elements in the right header files, according to their function and their dependencies.
- Cleaning up some old and mostly-dead code.
- Moving some functions into anonymous namespaces to prevent symbol export.
clang-tidy: error: use of undeclared identifier 'crash_handler' [clang-diagnostic-error]
not useful
clang-tidy: error: cannot initialize return object of type 'int' with an rvalue of type 'nullptr_t' [clang-diagnostic-error]
not useful