moved license out of every file, started to fix php docs and remove closing php tags, fixed a bunch of typos in type system