First version of RefExpander

UGLY AS HELL.

But first answer to issue #41.

I need a mutable tree, this really won't do.

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