Improve JavaDoc and put license headers

Change-Id: Ib851aafd32b6b3ee4d5ba7f8954b805605b250e9