Some includes were missing in .h files, and the tests must be linked with intl and execinfo on FreeBSD.