Refactor code to be stateless and browser-friendly

This (hopefully) makes the code a bit more stateless and browser
compatible. By making the `extractInfo` function take HTML after it has
been loaded into cheerio, rather than as a string, it becomes browser
compatible.