taking code out of app and putting it in core, adding more tests
handling .gitignore and empty directories