Refactorize a lot of code, and rename ADDON_ROOT to ADDON_DATA.