[Code Style]Clean up libraries/joomla

A first PR on the libraries/joomla folder. This is an all-in-one PR for the files done so far. More PR will follow but per folder to keep it maintainable.