Fix .gitignore and folder structure

This patch rebuilds the .gitignore file, removes build junk and puts the files in the right places.