Improve maybe_upgrade() upgrade routine

* Use $wpdb->update()
* Only flush the cache if rows were affected
Clean up get_targets() globals.
Change the terminology to "tab", since that's what browsers do now.
More complete "opens in new tab" functionality.

* New method: get_link()
* New method: get_target()
* Logs each link replacement done in the link() method and then adds
  targets via JS in footer if appropriate

fixes #4
Merge pull request #7 from markjaquith/open-in-new-window

Better "Open in a new window" implementation