Infrastructure for lazy queries in transactions

cc #13
More infrastructure for lazy queries

cc #13
Implement transactional lazy queries

Closes #13