changed semantics in query and managing keys
Updated docs, minor bugfixes