Added JPEG header check
Added experimental logging handler

only use during development, as there might be some leaks :)
refactored old EIO_* function names