Improve gitignore rules for modules and templates

Generic rules used to ignore the modules or  the templates which are not by default.