move stats to statstools and add histfactory script
update imports