Merge pull request #465 from EntradaProject/feature-templates

Feature templates
Replaces key_exists with array_key_exists
Missed key_exists instance.
Updates user_access query in authenticate.php
Fixed an issue in the User model which caused disabled or expired records to be loaded into a logged in user's available access records, and also a logic issue in the clerkship assertion which caused a value that didn't exist to be checked against sometimes.