[major] Test, coverage and emit refactor