MDL-37459 Admin form defaults - Refactored advanced and locked flags into an admin_setting_checkbox class

Makes the API a little cleaner and removes some duplication.