better stack traces for queries
better caching of node and relationship ids
added some tests