Add manage.rb
Implement thread pruning