Fix tests, export header files and update documentation