Unused caps remove, code format
Security fix, new version release

Add moodle internal definition requirement.
Add require cap check when necessary.
Alter version number