Robust DOM manipulation, comrade

This will allow the periodic stream check to go much easier.
Merge pull request #23 from goakley/master

Robust DOM manipulation, comrade