Simplified code, removed requirement for tdom package, now html parsing done
by javascript (browser).