Refactoring of AddonLoader.

- Should hopefully make code more readable/understandable