Refactored a large portion of calendar's blueprint and implemented run_query for easier coding