$ref support as a sort of preprocessor

Is this anything you'd be interested in?  It was required for a project and we'd love to contribute it back.