backport fromfile fix to 1.8

fromfile changes from gh-4152, gh-4165, gh-4187, gh-4196
also include the travis improvements in master.

This changes the API of the 3kcompat header which is a little problematic for a maintenance release. We could keep the API by adding internal copies to fix the bug. On the other hand already compiled applications using the functions will continue to work (but be broken) as it are only inline header functions.