Splited almost all functions on individual files on R dir. Corrected many nasty bugs on re-fitting of items