Use simpler algorithm.

This handles things like `**hi***there*` and gives symmetrical
treatment of `**hi*` and `*hi**`.

Also handles the case from #147.
Some jshint fixes.