Adding code coverage reporting and improved tests