Convert ec2_init.expect to an API script.

Uses the VyOS CLI API which should be more reliable than expect.