TEST restructure the tests so that they are symbolic

It is better for error reporting, and gives us some room for refactoring
RESTRUCT extract some functions to ease reading