Refactor gitignore to support comments, \r\n and inclusions, also convert indent to tabs

The function will now add 2 glob patterns per line in the gitignore, one that is just the line and one ending in /** in case the line pertains to a folder, unless the line ends with a / in this case it is assumed the user only wanted to exclude the folder.