add license to TSI code

(I edited the files using the github editor, hence one commit for each file. feel free to squash before merging if you prefer)

edit: squashed