Add global onError handler with extensive tests, and update to Karma 2.0.