adapted to newest libs, new tests
Adapted to newest libs