Fix #174 - better "target" checking

Use a more sophisticated check for `target` on `a.click` and `form.submit` events.