move the threading code to threading.rb

yk - add "--threads" option