Added a configuration option to allow setting the number of threads in the config file