Previous commit did not fix timeout / cleanup

Moved some code over into processing.rb to make the main sinatra file
tinier.