refactored as much of the code as i can w/o
integration tests (selenium or phantomjs). lots of nasty global vars,
but then again this is a demo and webpage.js isn't part of the lib
so fuck you very much if you decide to use it.