Add copyright headers in accordance with license on all code files

This commit also changes the permission numbers for all the files in tools/.