convert to synchronous API

Promises are nice but got in the way of gulp streams.
pass tests broken by removing promises
adapt README for sync API
use htmlparser2
refactor for code reuse
fix some missing semicolons