Major refactoring of SparQL queries for massive speed-up.