fix cache clearing by deleting the cache folders
provide wrapper for _triggerEvent, make _loadLanguages protected
refactor and add missing tests