Add new library and header file (intern.{c,h}) which hold all functions that are only used internally in the DLL and are not exported

Fix an error where the absolute value should be taken of the difference,
and not of the separate elements, thanks @153957