FIX: Allow reference definitions with quotes

This patch allows reference definitions with quotes inside them. I think the test illustrates what it supports :)