add support for operating with element references

i really need to refactor these tests.  waaaaaayyyy too much copypasta.