Various LINQ to SPARQl bugfixes and tweaks, fixes #6

Corrected several LINQ to SPARQL issues in various query scenarios.
These changes required some refactorization, which was started, but
still it needs some more time.
Some optimizations were applied to the framework's core so operations on
entities and proxies are about 25% faster.