Rewrote karma plugin to accomodate logging and better testing.