Some cleanup of JPEG; moved bit reading into utilities