[Code Style] Changes in tag standards: Libraries/legacy

This pull should fix the issue detailed here: joomla/coding-standards#80

I have broken in parts this original pull #4590 to make it easy for review. This pull is contains only the libraries/legacy changes.
The components/, modules/, ... are going to be sent in different pulls.

This pull is related to #4603 and #4617