Fix project structure, update packages, fix token check and change license