Don't use the attributes when closing a block
Move code out of Compiler
Move parsing logic out of ReferenceCompiler