Auto-install unit tests

This adds unit tests for auto-installing extensions
* actually only 1 "test" to Extension Manager tests
* refactored code to facilitate testing
* added jsdoc annotations
* minor code cleanup
* fixes #9576

cc @dangoor 

This should probably say something about how `autoExtensions` represents previously installed extensions.