Underped some ruby and rewrote the HTML parser

1. Used Nokogiri instead of system commands
2. Rubified some of the code