First whack at #70 - schema compilation failure

The real problem was that the ref-compilation stage was not
distinguishing between objects in a schema that represent schemas
and objects that do not.  This commit fixes the failing test case,
but I am pretty sure I can find others.