Ab initio study of the electronic structure and hyperfine coupling in simple hydrocarbon radicals. I. Test of the calculation method on methyl and vinyl