Implements FFC1 marker (and syncs with jpgjs)

Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=766138 , #2578 and #3006