Fix indentation, refactor app/addon checking and add add-on private directory.