Code coverage

Use covert for code coverage instead of istanbul (file-based coverage tools are really annoying). Also added some tests to increase coverage.