Added decorators to caching system, extracted some more methods, added sqlQuery to do the most common query type.