Adding fake segmentsFrom and tests.
Adding application_from_segments with tests.