Reduce ORA cpu usage by caching some expensive queries

Currently, the ML grader will call the ORA server at 5 second intervals looking for grading to do.  This causes ORA to execute somewhat expensive queries once every 5 seconds.  This PR avoids that by caching the result of the expensive query and recalculating it at longer intervals.