src: split core into: cli, collector, visitor