Removing use of rework.references() and adding more tests (Fixes #1)