integrate jpegtran-cffi as alternate backend + some refactoring