Improve gitignore rules for modules and templates