[Encapsulation] Making JPEG absorb the bytes

Moving around logic to make the JPEG class interact with the file;
The segments now include their own markers;