Refactor to use gumbo-get-elements-by-tag-name

Simplifies quite a bit of logic, and has much cleaner memory handling.