JSON filereader and streamlined confinement analysis