Added support for karma testing. Fixes #3