Schedules working (mostly) and the line diagram shown with them is now working.
Added caching of queries to help the db load