Pulled file handling into shared module. Fixed gitignore