Make scripts handle tern dependencies