adding references() to compiled unit.

the compiled unit now contains a references() function. the references
is resolved from the compiled units declaration content, not the
compiled content.