initial commit

basic tests, and fixes:
- fix cycles
- fix immediately relative lookups