support multiple threads (adds "num-threads" configuration command that defaults to 1) (partially implements #8)