Implemented references and wrote tests for them

These allow us to construct proof steps and build proofs. We also added
logic to print references and adapted the lisp-syntax writer class to be
able to provide them with the information they need.