Several adjustments to validate command line paremeters correctly and expose suitable constructors to use via API.