[imp] Improve ignore files. Fixes #1472. Fixes #4477

New PR for https://github.com/joomla/joomla-cms/pull/1472 that improve the `.gitignore` file but is out of sync and against master

And tested by @Hackwar see https://github.com/joomla/joomla-cms/pull/1472#issuecomment-34482392