On the Safe Motion of Connected Automated Vehicles: Dynamics, Planning and Controls