Complete rewrite of ref resolver processing tests

First for canonical trees. I should probably extract that Dereferencing enum,
too.

Signed-off-by: Francis Galiegue <fgaliegue@gmail.com>