Add license header

According to GPL instructions, each source file should have
license header.

Headers on individual files were added automatically by
running `gradle licenseFormat`.

Also, this commit adds license checking to build.gradle.
Merge pull request #52 from slonopotamus/license_headers

Add license header
Merge branch 'master' into persistent-cache