General cleanup and added license comment to some files