Added extension auto reloading.
Minor refactoring.