Added mac specific file to .gitignore, new tests, minor refactoring