get_context_instance() is deprecated
Moodle2.7 USER object contains course access dates

The lastaccess dates can be found in the moodle 2.7 USER object
so when possibile the lastaccess dates are extracted directly
from the USER object. If this is not possible then the dates
are extracted directly from the database.