Add license headers where needed; minor cleanup elsewhere.