Added istanbul karma plugin to track test coverage
Added tests for the untested parts.