Added caching to some more intense SQL queries (graph data, mainly)