batched triple store selects for improved performance
fix statements
further code cleanups and optimizations
some more code improvements