Fix inline duplication warning.
Add tests.

(Yes, finally, there are tests! WHY DID I NOT DO THIS YEARS AGO?)
Make header-file C++-compatible.