More complete (and correct) API for references
Add a (working) test for references
Add tests for list and type_of